#ifndef CHECKBOX_H
#define CHECKBOX_H

#include "../Widget.h"
#include <string>

namespace PickinOpenSticks {
    namespace Ui {

        class CheckBox : public Widget {
        public:

            CheckBox() : checked(false) {
                type = CHECKBOX;
            }

            inline bool IsChecked() {
                return checked;
            }

            inline void Check() {
                checked = true;
            }

            inline void UnCheck() {
                checked = false;
            }
            void SetDefaultImage();
            void SetCheckedImage(const std::string& filename);
            void SetUnCheckedImage(const std::string& filename);

            inline void SetPos(int x, int y) {
                pos.x = x;
                pos.y = y;
                sprite.SetPosition(x, y);
                uncheckedSprite.SetPosition(x, y);
            }
        private:
            bool checked;
            sf::Sprite uncheckedSprite;


        protected:
            void Draw(sf::RenderTarget* target);

            void OnClickPressed(sf::Event* event) {
                checked = !checked;
            }

        };

    }
}
#endif
